home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cgraphix / displayc.c < prev    next >
Text File  |  1986-05-06  |  772b  |  57 lines

  1. /* «RM120»«PL99999»«TS4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76» */
  2. #include    <stdio.h>
  3. #define    EXTERN    extern
  4. #include    <typedef.h>
  5.  
  6.  
  7. void DC(C)
  8. unsigned char    C;
  9. {
  10.     int    i, j, y;
  11.     unsigned offset;
  12.  
  13.     y = 8 * YTextGlb;
  14.     j = 8 * C;
  15.  
  16.     for (i = 0; i < 8; i++) {
  17.         pokeb(BaseAddress(y++) + XTextGlb, GrafBase, Font[j++]);
  18.     }
  19. }
  20.  
  21.  
  22. void DisplayChar(C)
  23. int        C;
  24. {
  25.     struct regval    regs;
  26.  
  27.     if (!GrafModeGlb)
  28.         return;
  29.  
  30.     if (C == 8) {
  31.         if (XTextGlb > 1)
  32.             XTextGlb--;
  33.     }
  34.     else if (C == 10) {
  35.         if (YTextGlb < 25)
  36.             YTextGlb++;
  37.     }
  38.     else if (C == 13) {
  39.         XTextGlb = 1;
  40.     }
  41.     else {
  42.         DC(C);
  43.         if (XTextGlb < 80)
  44.             XTextGlb++;
  45.     }
  46. }
  47.  
  48.  
  49. void DisplayString(str)
  50. char    *str;
  51. {
  52.     while (*str != EOS)
  53.         DisplayChar(*(str++));
  54. }
  55.  
  56.  
  57.